<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('category', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title')->comment('栏目名称');
            $table->string('info')->comment('摘要')->nullable();
            $table->unsignedInteger('parent_id')->default(0)->nullable(); 
            $table->string('url')->nullable()->comment('指向外部链接');
            $table->text('content')->comment('单页面内容');
            $table->string('tpl_index')->nullable()->comment('栏目模板');
            $table->string('tpl_list')->nullable()->comment('列表模板');
            $table->string('tpl_content')->nullable()->comment('内容模板');
            $table->string('tpl_topic')->nullable()->comment('专题模板');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('category');
    }
}
